// pages/order/order-detail/order-detail.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    data: '',
    dizhi: '',
    heji: 0,
    imageurl:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let that = this;
    let orderId = options.id;
    that.setData({
      imageurl: app.globalData.baseImageUrl
    })
    app.post("/shop/orderDetail", {
      orderId: orderId
    }).then(res => {
      that.setData({
        data: res,
        dizhi: app.globalData.shopAddress
      })
      let a = that.data.data.info.xyhCommission?Number(parseFloat(that.data.data.info.xyhCommission)):0;
      let b = that.data.data.info.xsCommission?Number(parseFloat(that.data.data.info.xsCommission)):0;
      let heji = (a+b).toFixed(2);
      that.setData({
        heji: heji,
      })
    })
  },

})